<?php

$photos = [
    "android.jpg", "java.jpg",
    "oc.jpg","php.jpg",
    "ps.jpg","sql.jpg"
];
$p1 = array_slice($photos, 0, 3);
$p2 = array_slice($photos, 3); ?>
<ul>
    <?php
    foreach ($p1 as $p) :
        ?>
        <li><img src="img/<?php echo $p; ?>"></li>
    <?php endforeach ?>
</ul>

<!--右边-->
<ul>
    <?php
    foreach ($p2 as $p) :
        ?>
        <li><img src="img/<?php echo $p; ?>"></li>
    <?php endforeach ?>
</ul>